package com.zhiche.lisa.lspm.vo.attach;

import org.springframework.util.CollectionUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class LicenseVO implements Serializable {
    //证照类型
    private Long licenseTypeId;
    //所属id
    private Long belongedId;
    //所属类型
    private String belongedType; //("lsp,carrier,trailer,driver")

    private String cardId;//身份证信息

    private List<LicenseDetailVO> licenseDetails;

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    public Long getLicenseTypeId() {
        return licenseTypeId;
    }

    public void setLicenseTypeId(Long licenseTypeId) {
        this.licenseTypeId = licenseTypeId;
    }

    public Long getBelongedId() {
        return belongedId;
    }

    public void setBelongedId(Long belongedId) {
        this.belongedId = belongedId;
    }

    public String getBelongedType() {
        return belongedType;
    }

    public void setBelongedType(String belongedType) {
        this.belongedType = belongedType;
    }

    public List<LicenseDetailVO> getLicenseDetails() {
        return licenseDetails;
    }

    public void setLicenseDetails(List<LicenseDetailVO> licenseDetails) {
        this.licenseDetails = licenseDetails;
    }

    public void addLicenseDetails(LicenseDetailVO licenseDetail) {
        if (CollectionUtils.isEmpty(licenseDetails))
            licenseDetails = new ArrayList<>();
        licenseDetails.add(licenseDetail);
    }

    @Override
    public String toString() {
        return "LicenseVO{" +
                "licenseTypeId=" + licenseTypeId +
                ", belongedId=" + belongedId +
                ", belongedType='" + belongedType + '\'' +
                ", licenseDetailVOS=" + licenseDetails +
                '}';
    }
}
